#!/usr/bin/python
# -*- coding: utf-8 -*-

from _pylot.cli.interfaces.cliinterface import pyLotOptionParser
import sys

def launch_cli_module(cli_class, args=sys.argv):

  # create a Command Line Interface (CLI)
  parser = pyLotOptionParser()
  cli = cli_class(parser=parser)

  groups = cli.createOptionGroups()

  for group in groups :
    cli.parser.add_option_group(group)

  (options, args) = cli.parser.parse_args()

  return cli.parser, cli, options
